package lab8.task3;

public class T3Arrays {
	private static int avg(int[] array){
		int sum = 0;
		for (int i = 0; i < array.length; i++) {
			sum += array[i];
		}		
		return (sum/array.length);			
	}
	public static void main(String[] args) {
		String kr = " kratno 3";
		String nkr = " ne kratno 3";
		String sr = "Srednee arif: ";
		int[] array = new int[50];
		for (int i = 1; i < array.length; i++) {
			array[i] = i+1;
		}
		
		for (int i = 1; i < array.length; i++) {
			if(array[i]%3==0) {
				System.out.println(array[i] + kr);
				}
			else {
				System.out.println(array[i] + nkr);
				}
		}
		
		System.out.println(sr + avg(array));

		
	}

}
